"""
Created on 27-Jul-2009

@author: dexen
"""
import rpyc

default_config = {
    "allow_pickle":True,
    "instantiate_custom_exceptions":True,
}

class MyService(rpyc.Service):  
    def on_connect(self):
        print "Somebody connected."
    
    def on_disconnect(self):
        print "Somebody disconnected."
    
    def _rpyc_getattr(self, name):
        if not name.startswith("_"):
            return getattr(self, name)
        else:
            raise AttributeError("private attributes are not accessible.")
    
    def _rpyc_setattr(self, name, value):
        print "I am in setattr", name, value
        if not name.startswith("_"):
            return setattr(self, name, value)
        else:
            raise AttributeError("private data attributes cannot be set.")
    
    